<?php
/**
 * User: 1971229701@qq.com
 * Date: 2020/11/6/006
 * Time: 11:30
 */

namespace app\index\controller;


use app\index\logic\VideoLogic;
use think\App;
use think\Db;

class Video extends Base
{
    private $video_logic;

    public function __construct(App $app = null)
    {
        parent::__construct($app);
        $this->video_logic = new VideoLogic();
    }

    public function index()
    {
        $r = $this->video_logic->listing();
        $this->assign('video_banner', $r['video_banner']);
        $this->assign('hot_video', $r['hot_video']);
        $this->assign('private_video', $r['private_video']);
        $this->assign('original_video', $r['original_video']);
        $this->assign('web_title', '视频中心');
        return $this->fetch();
    }

    public function video_detail($id = 3)
    {
        $r = $this->video_logic->info($id);
        $this->assign('info', $r['info']);
        $this->assign('list', $r['list']);
        $this->assign('web_title', '视频详情页');
        return $this->fetch();
    }

    public function video_square($cate_id = '',$zuixin = '',$zuiduo = '',$haoche = '')
    {
        $r = $this->video_logic->video_square($cate_id,$zuixin,$zuiduo,$haoche);
        $this->assign('cate_list',$r['cate_list']);
        $this->assign('video_list',$r['video_list']);
        $this->assign('right_video',$r['right_video']);
        $this->assign('video_count',$r['video_count']);
        $this->assign('web_title','视频广场');
        $cate_id = !empty($_GET['cate_id'])?$_GET['cate_id']:0;
        $zuixin = !empty($_GET['zuixing'])?$_GET['zuixing']:0;
        $zuiduo = !empty($_GET['zuiduo'])?$_GET['zuiduo']:0;
        $haoche = !empty($_GET['haoche'])?$_GET['haoche']:0;
        $this->assign('cate_id',$cate_id);
        $this->assign('zuixing',$zuixin);
        $this->assign('zuiduo',$zuiduo);
        $this->assign('haoche',$haoche);

        return $this->fetch();
    }


}
